package com.storage.common.enums;

/**
 * 采购订单类型类型
 *
 * @author wb-zh270168
 */
public enum ProcurementType {

    USER_APPLICATION(1, "采购"),

    AGENT_SEND(2, "上级发货");

    private final int value;

    private final String desc;

    ProcurementType(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    /**
     * 根据 value 返回枚举
     * @param value
     * @return
     */
    public static ProcurementType valueOf(int value) {
        for (ProcurementType type : values()) {
            if (type.getValue() == value) {
                return type;
            }
        }
        return null;
    }
}
